﻿using CarterWechatServer.BizLogic.Account;
using CarterWechatServer.BizModel.Account;
using CarterWechatServer.Util.Result;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace CarterWechatServer.WebApi.Controllers
{
    /// <summary>
    /// 账户管理控制器
    /// </summary>
    public class AccountController : ApiController
    {
        private AccountService _accountService;


        public AccountController()
        {
            _accountService = new AccountService();
        }

        #region 用户注册状态

        /// <summary>
        /// 用户注册状态
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public DataResult<UserStatusOutput> Get(string code)
        {
            UserStatusOutput output = _accountService.UserStatus(code);
            return new DataResult<UserStatusOutput>(output);
        }

        #endregion

        #region 用户注册


        public DataResult<string> UserRegister(UserRegisterInput input)
        {
            _accountService.UserRegister(input);
            return new DataResult<string>(data: "用户注册成功");
        }
        #endregion
    }

}
